check_ip() {
    if ping -c 3 -W 2 "$1" > /dev/null 2>&1; then
        echo "success"
    else
        echo "fail"
    fi
}
check_ip "$1"

